
#将所有已选择英雄的玩家加入team
team join DieOutTeam @a[tag=DieOutSelectFinish]

##初始化大逃杀对局信息
#1、以随机管理员为中心，在其半径100-150格内随机生成蔓延中心：DieOutCenter，并初始化对局
execute as @r[tag=admin] at @s run summon armor_stand ~ ~ ~ {Tags:["DieOutCenter"],CustomNameVisible:1b,CustomName:'[{"text":"蔓延中心","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]',Invulnerable:1b,PersistenceRequired:1b,NoGravity:1b,Invisible:1,Rotation:[0f]}
execute as @e[type=armor_stand,tag=DieOutCenter] at @s run spreadplayers ~ ~ 100 150 false @s
#2、将所有DieOutTeam玩家以此为中心20-80范围内扩散
execute at @e[type=armor_stand,tag=DieOutCenter] run spreadplayers ~ ~ 10 40 false @a[team=DieOutTeam]
#3、生成：RunAwayCenter
execute at @e[type=armor_stand,tag=DieOutCenter] run summon armor_stand ~ ~ ~ {Tags:["RunAwayCenter"],Invulnerable:1b,PersistenceRequired:1b,NoGravity:1b,Invisible:1,Rotation:[0f]}


##初始化下一阶段
scoreboard players set IsTheDieOutGame SystemAdmin 4
worldborder set 100 0
worldborder damage amount 0
#重置刷圈次数与等待刷圈时间
scoreboard players set UpdateCount DieOutInfo 12
scoreboard players set TimeClock DieOutInfo 90



##清理本阶段——————————————————————————————————————————————————————————————————————————————————
tellraw @a [{"text":"[大逃杀] ","color":"red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"本次对局已开始，毒区将在 ","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"color":"aqua","score":{"objective":"DieOutInfo","name":"TimeClock"},"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s 后开始蔓延","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"\n剩余存活玩家：","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"selector":"@a[team=DieOutTeam]","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
#若有哪些玩家未选择英雄，提示哪些玩家放弃了本次对局
execute if entity @a[tag=!DieOutSelectFinish] run tellraw @a [{"text":"[大逃杀] ","color":"red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"这些玩家放弃了本次","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"大逃杀对局\n","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"selector":"@a[tag=!DieOutSelectFinish]","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute as @a[tag=!DieOutSelectFinish] at @s run scoreboard players set @s SystemDeath 2

#玩家入场后移除所有玩家的DieOutSelectFinish标签
tag @a remove DieOutSelectFinish